package com.scnu409.Adapter;

import com.scnu409.fragment.CommunityFragment;
import com.scnu409.fragment.FriendFragment;
import com.scnu409.fragment.HistoryContentFragment;
import com.scnu409.fragment.TimeRouteFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class TabFragmentAdapter extends FragmentPagerAdapter{

	public TabFragmentAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int arg0) {
		// TODO Auto-generated method stub
		Fragment fragment=null;
		switch(arg0){
		case 0:{
			fragment=new HistoryContentFragment();
			break;
		}
		case 1:{
			fragment=new FriendFragment();
			break;
		}
		case 2:{
			fragment=new TimeRouteFragment();
			break;
		}
		case 3:{
			fragment=new CommunityFragment();
			break;
		}
		}
		return fragment;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 4;
	}

}
